<?php
defined('SYS_RUN') or exit();

abstract class AController {

    static $_instance = array();

    function __get($name) {
        if(!isset(self::$_instance[$name]))
            self::$_instance[$name] = Lib::get($name);
        return self::$_instance[$name];
    }

    protected function render($template, $params = null, $layout = null) {
        Lib::get('template')->render($template, $params, $layout);
    }

    protected function renderPartial($template, $params = null, $returnHtml = false) {
        return Lib::get('template')->renderPartial($template, $params, $returnHtml);
    }

    protected function setTitle($title) {
        Lib::get('template')->setTitle($title);
    }
}